#ifndef RAM_FLASH_H
#define RAM_FLASH_H
#include "gd32f4xx.h"

#define FLASH_SECTOR_0			0X08000000
#define FLASH_SECTOR_1			0X08000400
#define FLASH_SECTOR_2			0X08000800
#define FLASH_SECTOR_3			0X08000C00
#define FLASH_SECTOR_4			0X08010000
#define FLASH_SECTOR_5			0X08020000
#define FLASH_SECTOR_6			0X08040000
#define FLASH_SECTOR_7			0X08060000
#define FLASH_SECTOR_8			0X08080000
#define FLASH_SECTOR_9			0X080A0000
#define FLASH_SECTOR_10			0X080C0000
#define FLASH_SECTOR_11			0X080E0000


void GDFLASH_Read(unsigned int readAddr,unsigned int* pBuffer,unsigned int numASize);
void FlashWrite(unsigned int writeAddr,unsigned int* writeData,unsigned int writelength);
unsigned int FlashReadWord(unsigned int readAddr);
void GD32_WriteFlash(uint32_t saddr, uint32_t *wdata, uint32_t wnum);
void GD32_EraseFlash(uint32_t start, uint16_t num);
#endif 

